package com.xw.functionService.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.xw.functionService.mapper.ArticleMapper;
import com.xw.functionService.model.Article;
import com.xw.functionService.service.ArticleService;

/**
 * 文章接口实现类
 * @author xiaoshengda
 *
 * @date 创建时间：2018年4月5日 上午11:55:14
 */
@Service
public class ArticleServiceImpl implements ArticleService {
	@Autowired
	private ArticleMapper articleMapper;

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public void del(Long articleId) {
		this.articleMapper.del(articleId);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public void insert(Article article) {
		this.articleMapper.insert(article);
	}

	@Override
	public Article loadById(Long articleId) {
		return this.articleMapper.loadById(articleId);
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public void update(Article article) {
		this.articleMapper.update(article);
	}

}
